package com.test.consumer.mapper;

import com.test.consumer.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author liran
 */
@Repository
public interface UserMapper {

    @Insert("INSERT INTO `mq_user` ( `name`, `pass`) VALUES ( #{name}, #{pass})")
    int insert(User user);

    @Select("SELECT COUNT(*) FROM mq_user WHERE `name`= #{name}")
    int selectByName(User user);
}
